home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / glibc-1.09 / glibc-1 / glibc-1.09.1 / sysdeps / unix / sysv / sco3.2.4 / uname.S < prev   
Encoding:
Text File  |  1994-07-18  |  1.4 KB  |  43 lines

  1. /* Copyright (C) 1993, 1994 Free Software Foundation, Inc.
  2.    Contributed by Scott Bartram.
  3.  
  4. This file is part of the GNU C Library.
  5.  
  6. The GNU C Library is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU Library General Public License as
  8. published by the Free Software Foundation; either version 2 of the
  9. License, or (at your option) any later version.
  10.  
  11. The GNU C Library is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14. Library General Public License for more details.
  15.  
  16. You should have received a copy of the GNU Library General Public
  17. License along with the GNU C Library; see the file COPYING.LIB.  If
  18. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  19. Cambridge, MA 02139, USA.  */
  20.  
  21. #include <sysdep.h>
  22.  
  23. /* 
  24.     before lcall, stack contents should be:
  25.  
  26.     4(%esp) -> name
  27.     8(%esp) -> unspecified
  28.     12(%esp) -> 0
  29.  */
  30.  
  31. ENTRY (uname)
  32.     pushl $0x0        /* Push the discriminator flag.  */
  33.     pushl $0x0        /* Push dummy placeholder.  */
  34.     pushl 12(%esp,1)    /* Push NAME (ptr to struct utsname)  */
  35.     subl $0x4, %esp        /* Adjust stack pointer.  */
  36.     DO_CALL (utssys, 3)
  37.     jb error        /* Test for error.  */
  38.     addl $0x10, %esp    /* Adjust the stack pointer.  */
  39.     xorl %eax, %eax        /* Clear return value.  */
  40.     ret
  41. error:    addl $0x10, %esp    /* Adjust the stack pointer.  */
  42.     jmp syscall_error
  43.